home *** CD-ROM | disk | FTP | other *** search
- A SHORT NOTE ABOUT SDIR
-
- An interesting comparison can be made between the responses of
- SDIR and CHKDSK when run on the same disk. You will note that they
- both agree on the amount of free space remaining on the disk. However
- if you take the trouble to add the sizes of the files as described by
- SDIR you will find it adds up to less than the "amount in user files"
- described by CHKDSK. Your first response is to assume that SDIR is
- wrong since it was written by a human and CHKDSK comes from IBM.
- However, if you run DIR (which also comes from IBM), you will find
- that it agrees -file by file- with the sizes given by SDIR. This leads
- you to conclude that CHKDSK and DIR do not agree with each other.
- How come? The answer has to do with the fact that PC-DOS -in effect-
- reserves some book-keeping space to keep track of each file. The more
- files you add to the disk, the more book-keeping space it reserves.
- If you delete all files but one from a disk, you will find that SDIR,
- CHKDSK, and DIR all agree. In my experiments, I found that this
- extra space used by the system was roughly 15% of the file size, but
- I wouldn't count on this as a constant since I think it is a function
- of file sizes, number of files, degree of file fragmentation,etc.
- In other words, SDIR and DIR are telling you the amount of space that
- the actual files are using while CHKDSK is telling you the TOTAL amount
- of space that has been used up. This also helps explain the situation
- where you supposedly have 10,000 bytes left, but when you try to add
- a 9,500 byte file, the system responds with "disk full". The file
- plus the added book-keeping space was actually greater than 10,000.
- In other words, you can't really count on any of them other than as
- an approximate guide. Terrific huh?
- Ken Eagle (302) 475-2763